package com.itheima.test;

import com.itheima.mapper.LoginMapper;
import com.itheima.pojo.KsClass;
import com.itheima.pojo.User;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @author 28066
 * @version 1.0
 * @description: TODO
 * @date 2022/11/11 16:21
 */
@SpringBootTest
public class T0 {
    @Autowired
    private LoginMapper loginMapper;
    @Test  //测试登录根据用户名查询用户sql是否正确
    public void t1(){
        User byMobile = loginMapper.findByMobile("13012345678");
        System.out.println(byMobile);
    }
    @Test //测试查询所有班级是否成功
    public void t2(){
        List<KsClass> allClass = loginMapper.findAllClass();
        for (KsClass aClass : allClass) {
            System.out.println(aClass);
        }
    }
    @Test
    public void t3(){
        Integer id = loginMapper.findClassId("A210305883");
        System.out.println(id);
    }
    @Test
    public void t4(){
        KsClass aClass = loginMapper.findClass(1);
        System.out.println(aClass);
    }

}
